﻿//=============================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 作 者：孙德响
// 日 期：2011-11-10
// 描 述: 心得点评管理业务处理类
//
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00   2011/11/10    孙德响           
//=============================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZX.TR.Library;

namespace ZX.TR.Bussiness
{
    public  class BTrGainShare : BLL.Extend.BaseBussnies
    {
        ///// <summary>
        ///// 获取实体信息
        ///// </summary>
        ///// <param name="Condition">条件</param>
        ///// <returns>实体集合</returns>
        //public override IList<DBModule.BaseEntity>  GetEntitys(string Condition)
        //{
        //    this.entity = new TrGainShare();
        //    return base.GetEntitys(Condition);                         
        //}        
        /// <summary>
        /// 更新信息
        /// </summary>
        public bool UpdateTrGainShare(TrGainShare GainShare)
        {
            ZX.SPL.Factory.DialectFactory DF = ZX.SPL.Factory.Dialects.GetDialect(entity);
            return DF.Update("CheckContent='" + GainShare.CheckContent + "' ,CheckUserid='" + GainShare.CheckUserid.ToString() + "',CheckTime='" + GainShare.CheckTime.ToString() + "'", " TrGainShareID='" + GainShare.TrGainShareID.ToString() + "'");
        }
        /// <summary>
        /// 获取心得信息
        /// </summary>
        /// <param name="Condition">条件</param>
        /// <returns></returns>
        public TrGainShare GetTrGainShare(string Condition)
        {
            this.entity = new TrGainShare();
            return (TrGainShare)this.GetEntityByCondition(Condition);
        }

        /// <summary>
        /// 获取心得信息
        /// </summary>
        /// <param name="Condition">条件</param>
        /// <returns></returns>
        public TrStudyGain GetTrStudyGain(string Condition)
        {
            this.entity = new TrStudyGain();
            return (TrStudyGain)this.GetEntityByCondition(Condition);
        }
        /// <summary>
        /// 获取心得相信信息
        /// </summary>
        /// <param name="Condition"></param>
        /// <returns></returns>
        public IList<V_TrGainShareDetail> GetShareDetail(string Condition)
        {
            this.entity = new V_TrGainShareDetail();
            return this.GetEntitys<V_TrGainShareDetail>(Condition);           
        }

        /// <summary>
        /// 更新信息
        /// </summary>
        /// <returns></returns>
        public bool UpdateTrStudyGain(TrStudyGain acourse)
        {
            this.entity = new TrStudyGain();
            ZX.SPL.Factory.DialectFactory DF = ZX.SPL.Factory.Dialects.GetDialect(entity);
            return DF.Update("Gain='" + acourse.Gain + "',PreResult='" + acourse.PreResult.ToString() + "',Measure='" + acourse.Measure.ToString() + "' ,Punish='" + acourse.Punish + "'", "TrStudyGainID='" + acourse.TrStudyGainID.ToString() + "'");
        }
        /// <summary>
        /// 获取点评信息
        /// </summary>
        /// <param name="Condition">条件</param>
        /// <returns></returns>
        public TrStudyGainCheck GetTrStudyGainCheck(string Condition)
        {
            this.entity = new TrStudyGainCheck();
            return (TrStudyGainCheck)this.GetEntityByCondition(Condition);
        }

        /// <summary>
        /// 获取点评信息
        /// </summary>
        /// <param name="Condition">条件</param>
        /// <returns></returns>
        public IList<V_TrStudyGainCheck> GetVTrStudyGainCheck(string Condition)
        {
            this.entity = new V_TrStudyGainCheck();
            return this.GetEntitys<V_TrStudyGainCheck>(Condition);
        }
        /// <summary>
        /// 更新信息
        /// </summary>
        /// <returns></returns>
        public bool UpdateTrStudyGainCheck(TrStudyGainCheck acourse)
        {
            this.entity = new TrStudyGainCheck();
            ZX.SPL.Factory.DialectFactory DF = ZX.SPL.Factory.Dialects.GetDialect(entity);
            return DF.Update("GainContent='" + acourse.GainContent + "'", "TrStudyGainCheckID='" + acourse.TrStudyGainCheckID.ToString() + "'");
        }
    }
}
